package com.jy.rhin.infra.cda.zhiyu;

import lombok.Getter;

@Getter
public enum XingBieDM {
    WeiZhi(0, "未知的性别"),
    Nan(1, "男性"),
    Nv(2, "女性"),
    WeiShuoMin(9, "未说明的性别");

    private Integer code;
    private String desc;

    XingBieDM(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getDescByCode(Integer code) {
        for (XingBieDM enmu : XingBieDM.values()) {
            if (enmu.getCode().equals(code)) {
                return enmu.getDesc();
            }
        }
        return null;
    }
}
